﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.ComponentModel;

namespace Clarius.PresentationModel.Tests
{
	public partial class MyPresenter : IChangeTracking
	{
		int _publicReadPrivateWriteProp;
		bool _value;
		string _content;
		string _title;
		public bool IsSubmitted = false;

		public string Title
		{
			get { return _title; }
			set { this.RaiseTitleChanging(); _title = value; this.RaiseTitleChanged(); }
		}
		public string Content
		{
			get { return _content; }
			set { this.RaiseContentChanging(); _content = value; this.RaiseContentChanged(); }
		}
		public bool Value
		{
			get { return _value; }
			set { this.RaiseValueChanging(); _value = value; this.RaiseValueChanged(); }
		}

		public int CalculatedProperty
		{
			get { return Title.Length; }
		}

		public int PublicReadPrivateWriteProp
		{
			get { return _publicReadPrivateWriteProp; }
			private set { this.RaisePublicReadPrivateWritePropChanging(); _publicReadPrivateWriteProp = value; this.RaisePublicReadPrivateWritePropChanged(); }
		}

		public void SetData(string title, string content)
		{
			Title = title;
			Content = content;
			RaiseCalculatedPropertyChanged();
		}

		public bool CanSubmit()
		{
			return true;
		}

		public void Submit()
		{
			this.IsSubmitted = true;
		}
	}
}
